package ck.com.api;

import ck.com.dto.Dto;
import ck.com.pojo.Role;
import ck.com.pojo.RoleCount;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;
@RequestMapping("/role")
public interface RoleApi {
    @RequestMapping("/selectRole")
    Dto<PageInfo<Role>> selRole(@RequestBody Map<String, Object> map);
    @RequestMapping("/add")
    Dto<Integer> add(@RequestBody Role role);
    @RequestMapping("/upd")
    Dto<Integer> upd(@RequestBody Role role);
    @RequestMapping("/selByName")
    Dto<Role> selByRoleName(@RequestParam("roleName") String roleName);
    @RequestMapping("/delete")
    Dto<Integer> del(@RequestParam("id") Integer id);
    @RequestMapping("/choice")
    Dto<List<Role>> choice();
    @RequestMapping("/selRoleByUserId")
    Dto<Integer> selRoleByUserId(@RequestParam("userId") Integer userId);
    @RequestMapping("/countRole")
    Dto<List<RoleCount>> roleCount();
}
